<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<link rel="stylesheet" type="text/css" href="css/po.css">
</head>
<body>
	<div class="bannerS">
		<div class="bantie">
			<div class="bancon">
				
			</div>
		</div>	
		<!-- 导航栏 -->
	<div class="nav ">
		<div class="banner">
			<img src="https://www.buchouwang.com/img/logo.a2dacc49.png">
		</div>
		<div class="nav-center">
			<a href="./index.html" class="item-on">首页 <span></span></a>
			<a href="javascript:;" class="product">产品介绍 <span></span>
				<div class="Invisibility">
				<div class="subnav"></div>
			</div>
			</a>
			
			<a href="./sec.html">解决方案 <span></span></a>
			<a href="./cases.html">案例展示 <span></span></a>
			<a href="./news.html">新闻中心 
				<span></span>
				
			</a>
			<a href="./about.html">关于我们 <span></span></a>
			<a href="./careers.html">加入我们 
				<span></span>
			</a>
			<a href="./pig.html">生猪交易 <span></span></a>
			<a href="./demo.html">申请演示 <span></span></a>
		</div>
        
	</div>
	</div>
	<!-- 首页-产品介绍 -->
	<div class="detail-wrap">
		<div class="center-wrap">
			<div class="detail-title">
				首页 > 产品介绍 > 
			</div>
		</div>
		<div class="detail-content-wrap clearfix">
			<div class="content-left">
			</div>
			<div class="content-right">
				<div class="right-title">
					案例展示
					<span class="right-more">更多——></span>
				</div>
				<div class="content-list">
					<ul>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<!-- 网页底部 -->
	
	<script type="text/javascript" src="ajax.js"></script>
	<script type="text/javascript" src="jquery-3.2.1.js"></script>
	<script type="text/javascript">
		console.log(location.href)
		let id = location.href.split('=')[1];



			//二级导航
			let subnav = document.querySelector(".subnav")
			ajax({
			  method: "get",
			  url: "stage-api/website/getProductMenuInfo",
			}).then(res => {
			  for(let i = 0; i < res.data.length; i++){
			    if (i == 4) {
			      continue;
			    }else if(i == 6){
			      continue;
			    }else{
			      subnav.innerHTML += `<div class="subtag" onclick=detail('${res.data[i].productId}')>
			                            <img src=${res.data[i].menuIcon.split("?")[0]}>
			                            <p>${res.data[i].productName}</p >
			                            </div>`
			    }
			  }
			})


			let bancon = document.querySelector(".bancon")
			let details = document.querySelector(".detail-title")
			let conleft = document.querySelector(".content-left")
			let  ul = document.querySelector("ul")
			ajax({
				method: "get",
				url: "stage-api/website/getProductDetails",
				params: {
					productId: id,
				}
			}).then(res => {
				console.log(res)
				bancon.innerHTML = `<div class="contie">${res.data.productDetails.productName}</div>
									<div class="consetie">${res.data.productDetails.productName}</div>`
				details.innerHTML += `<span>${res.data.productDetails.productName}</span>`
				conleft.innerHTML = `<div class="content-left-title">${res.data.productDetails.productName}</div>
				<div class="content-left-text">${res.data.productDetails.productIntroduce}</div>`
					for(let i = 0; i <= 6; i++){
				ul.innerHTML += `<li class="item-wrap">
							<div class="item">
							<div class="item-left">
								<img src="${res.data.companies[i].companyLogoPhoto.split("?")[0]}">
							</div>
							<div class="item-right">
							<div class="item-text">${res.data.companies[i].caseCompanyName}</div>
							<div class="item-time">${res.data.companies[i].createTime.split(" ")[0]}</div>
							</div>
							</div>
						</li>`
					}
			    })

			//   // 大标题
			
			
			
			
			   function detail(productId){
			    location.href = `po.html?productId=${productId}`
			  }
            
			   $(".product").hover(function(){
				  $(".Invisibility").css("display", "block")
				}, function(){
				  $(".Invisibility").css("display", "none")
				})
	</script>
</body>
</html>